package jane.android.lwna;

import android.app.Service;  
import android.content.Intent;  
import android.media.MediaPlayer;  
import android.os.IBinder;  
//import android.os.Vibrator;暂时注销震动功能
import android.util.Log;  
  
public class playing extends Service {  
    private static final String TAG = "playing";  
    MediaPlayer player;  
    //Vibrator vibrator;  

    @Override  
    public IBinder onBind(Intent intent) {  
        return null;  
    }  
      
    @Override  
    public void onCreate() {  
        /*Toast.makeText(this, "My Service Created", Toast.LENGTH_LONG).show();  
        Log.d(TAG, "onCreate");  */
          
        player = MediaPlayer.create(this, R.raw.ask);  
        player.setLooping(true); // Set looping  
        
    }  
  
    @Override  
    public void onDestroy() {  
        //Toast.makeText(this, "My Service Stopped", Toast.LENGTH_LONG).show();  
        Log.d(TAG, "onDestroy");  
        player.stop();  
        
    }  
      
    @Override  
    public void onStart(Intent intent, int startid) {  
        //Toast.makeText(this, "playing Started", Toast.LENGTH_LONG).show();  
        Log.d(TAG, "onStart");  
        player.start();  
    }  
}  